import 'dart:async';

import 'package:rxdart/rxdart.dart';
import 'package:bloc_pattern/bloc_pattern.dart';


class IncrementBloc extends BlocBase {

  IncrementBloc();

  var counter = 0;
  var _incrementBloc = BehaviorSubject<int>.seeded(0);
  
  Stream<int> get outScreen => _incrementBloc.stream;
  Sink<int> get inScreen => _incrementBloc.sink;

  void increment() {
    counter ++;
    inScreen.add(_incrementBloc.value + 1);

  }

  @override
  void dispose() {
    // TODO: implement dispose
    _incrementBloc.close();
    
  }

}




